using System;
using System.Diagnostics;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using GetStartedApp.ViewModels;

namespace GetStartedApp.Views;

public partial class MainWindow : Window {
    public MainWindow() {
        InitializeComponent();
    }

    private void Button_OnClick(object? sender, RoutedEventArgs e) {
        Debug.WriteLine($"Click! Celsius={Celsius.Text}");
        if (Double.TryParse(Celsius.Text, out double C)) {
            var F = C * (9d / 5d) + 32;
            Fahrenheit.Text = F.ToString();
        } else {
            Celsius.Text = "0";
            Fahrenheit.Text = "0";
        }
    }
}